package com.cloudkinto.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.UserDo;
import com.cloudkinto.vo.role.menu.MenuNewTreeRes;
import com.cloudkinto.vo.user.*;
import com.cloudkinto.vo.user.login.ChangeWhReq;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-05-27
 */
public interface UserService extends IService<UserDo> {

    //用户登录
    UserLoginSuccessRes login(UserLoginReq req, HttpServletRequest request, String source);

    UserLoginSuccessRes changeWh(HttpServletRequest request, ChangeWhReq req, Long userId, Long tenantId);

    List<MenuNewTreeRes> getMenuTree(String token, String source);

    UserInfoRes getUserInfo(String token, String source);

    String getHeaderUrl(String type);

    //退出登录
    void logout(String token);

    //用户注册
    UserRegisterReq register(UserRegisterReq req);

    SingleResult addInit(Long companyId, Long tenantId, String source);

    UserBuildReq add(UserBuildReq req, Long userId, Long companyId, Long tenantId, String source);

    void check(UserCheckReq req, Long userId, Long companyId, Long tenantId, String source);

    SingleResult updateInit(Long id, Long companyId, Long tenantId, String source);

    UserUpdateReq update(UserUpdateReq updateVo, Long userId, Long companyId, Long tenantId, String source);

    UpdatePasswordReq updatePassword(UpdatePasswordReq req, Long userId, Long companyId, Long tenantId, String source);

    int delete(Long id, Long userId, Long companyId, Long tenantId, String source);

    SingleResult verificationCode();

    SingleResult pageInit(Long companyId, Long tenantId, String source);

    PageResult getListPage(Map<String, Object> map);

    UserLoginSuccessRes main(String token, String source);

    Object detail(Long id, Long companyId, Long tenantId, String source);

    Long getUserTenantId(Long userId);

    String getUserAccount(Long userId);

    List<UserDo> getPickList(Long tenantId);
}
